package com.juntuo.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.juntuo.entity.Company;
import com.juntuo.mapper.CompanyMapper;
import com.juntuo.service.CompanyService;
import com.juntuo.service.helper.CommonServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


@Service
public class CompanyServiceImpl extends CommonServiceImpl<Company> implements CompanyService {

    @Autowired
    private CompanyMapper companyMapper;
    @Override
    public PageInfo<Company> findPagedCompany(int pageNumber, int pageSize, String name) {
        PageHelper.startPage(pageNumber,pageSize);
        List<Company> companies=companyMapper.selectByName(name);
        PageInfo pageInfo= new PageInfo(companies);
        return pageInfo;
    }
}
